package com.ff.device.exception;


import com.ff.device.result.CodeMsg;

public class CustomException extends RuntimeException{

   private int code;

   private String message;

   private CodeMsg codeMsg;

    public CustomException(int code,String message) {
        super(message);
        this.code=code;
        this.message=message;
    }

    public CustomException(CodeMsg codeMsg) {
        super(codeMsg.getMsg());
        new CustomException(codeMsg.getCode(),codeMsg.getMsg());
        this.codeMsg=codeMsg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public CodeMsg getCodeMsg() {
        return codeMsg;
    }

    public void setCodeMsg(CodeMsg codeMsg) {
        this.codeMsg = codeMsg;
    }
}
